package com.share.example.selenium.web;

import com.share.common.common.Result;
import com.share.example.selenium.service.amazon.buy.AmazonBuyLoginService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RestController
@RequestMapping("/amazon/buy")
public class AmazonBuyController {
    @Autowired
    private AmazonBuyLoginService buyLoginService;

    //打开买家---填写表单页面
    @RequestMapping("/open/login/page")
    public Result openLoginPage() {
        return Result.bool(buyLoginService.openLoginPage());
    }

    //填写买家表单页面
    @RequestMapping("/fix/login/form")
    public Result fixLoginform(String account, String password) {
        Boolean aBoolean = buyLoginService.fixAccountLoginform(account);
        Boolean aBoolean1 = buyLoginService.fixPassWordLoginform(password);
        return Result.bool(aBoolean && aBoolean1);
    }
}
